#include "point.h"
#include <iostream>


Point::Point(int a,int b):x(a),y(b){}
Point Point::operator-(const Point& A)
{

Point B(x-A.x,y-A.y);
return B;
}

void Point::afficher()
{
	cout<<"x est :\n"<<x<<endl;
	cout<<"y est :\n"<<y<<endl;
}

bool Point::operator==(const Point& A)
{
	if(x==A.x && y==A.y)
	{
		
		return true;
	}
	return false;
}

Point Point::operator+(long n)
{
	Point R(x+n,y+n);
	return R;
}

void Point::operator+=(long n)
{
	x+=n;
	y+=n;
}

Point operator+(long n, const Point& A)

{
	Point R(n+A.x,n+A.y);
	return R;
}
ostream& operator<<( ostream& out,const Point& A)
{
	out<<"x est :\n"<<A.x<<endl;
	out<<"y est :\n"<<A.y<<endl;
	return out;
}

istream& operator>>( istream& in, Point& A)
{
	cout<<"entrer x et y :\n";
	in>>A.x;
	in>>A.y;
	return in;
}

